<!DOCTYPE html>
  <html lang="zh-cn">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
      <title>设置账户</title>
      <link href="__PUBLIC__/mobile/css/mui.min.css" rel="stylesheet"/>
      <link href="__PUBLIC__/mobile/css/sty.css" rel="stylesheet"/>
      <style type="text/css">
          html{height: 100%;}
          .xreaccBg{background:url(__PUBLIC__/mobile/images/mobileBg.png) no-repeat center center;background-size: 100%,100%;}
      </style>
      <script src="__PUBLIC__/mobile/js/jquery-1.9.1.js" type="text/javascript" charset="utf-8"></script>
    </head>
    <body class="xreaccBg">
      <header class="mui-bar mui-bar-nav">
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
        <h1 class="mui-title">设置账户</h1>
      </header>
      <div class="mui-content">
      <form class="mui-input-group xreaccForm" id='form' action="" method="post">
          <div class="mui-input-row">
            <label><span class="mui-icon mui-icon-locked"></span></label>
            <input id='ps' type="password" name="password" class="mui-input-clear" placeholder="请输入密码" data-input-clear="5"><span class="mui-icon mui-icon-clear mui-hidden"></span>
          </div>
          <div class="mui-input-row">
            <label><span class="mui-icon mui-icon-locked"></span></label>
            <input id='ps_ok'  type="password" name="repassword" class="mui-input-clear" placeholder="请再次输入密码" data-input-clear="5"><span class="mui-icon mui-icon-clear mui-hidden"></span>
          </div>
          <button type="button" class="xlogin" id="btnsubmit">确定</button>
      </form>
      </div>
      <script type="text/javascript" src="__PUBLIC__/mobile/js/mui.min.js"></script>
      <script type="text/javascript">
        $('#btnsubmit').click(function(){ 
          var password = $('#ps').val();
          var repassword = $('#ps_ok').val();
          if($('#ps').val()!='' && $('#ps_ok').val()!='')
          {
              if($('#ps').val()==$('#ps_ok').val())
              {
                  $.ajax({
                    url: "<{:U('login/reaccount')}>",
                    type: 'post',
                    data: {password:password},
                    success:function(mes){
                      // alert(mes);
                      if(mes == 0){
                        alert('密码修改失败！');
                      }else if(mes == 1){
                        window.location.href = "<{:U('index/index')}>";
                      }
                    }
                  });
                  // $('#form').submit();
              }
              else{
                   alert('两次输入的密码不一致');
              }
          }
          else{
              alert('表单不能为空');
          }                                
        });
      </script>
    </body>
  </html>
